<form class="form-inline" action="<?php echo $this->url('/ticket/requestBooking'); ?>" id="request-seats" method="GET">
  <input type="hidden" name="show_id" class="show_id" value="" />
  <input type="hidden" name="hall_id" class="hall_id" value="" />
  <input type="hidden" name="representation_id" class="representation_id" value="" />

  <input type="text" id="seats" name="seats" placeholder="No of Seats">
  <button type="submit" class="submit btnd">Get seats</button>
</form>


<form class="form-inline" action="<?php echo $this->url('/ticket/requestBooking'); ?>" id="confirm-booking" method="GET">
  <input type="hidden" name="show_id" class="show_id" value="" />
  <input type="hidden" name="hall_id" class="hall_id" value="" />
  <input type="hidden" name="representation_id" class="representation_id" value="" />

  <input type="text" id="name" name="name" placeholder="Name">
  <button type="submit" class="submit btnd">Place Booking</button>
</form>


<div style="float: left">
    <div style="float: left; display: none;" id="selected_seats">
        <div style="float: left; width: 150px; line-height: 30px"><i class="icon-hand-right"></i> <strong>Your Seats:</strong></div>
        <span></span>
    </div>
</div>

<br style="clear: both" />

<div class="tabbable" id="hall_tabs">
    <ul class="nav nav-tabs hall_trigger_tab" style="margin-left: 100px">
    <?php
        $order = 0;
        foreach ($halls as $id => $hallData) {
            $class = $order == 0 ? ' class="active trigger"' : ' class="trigger"';

            echo '<li', $class, '><a href="#hall', $id, '" id="trigger_hall', $id, '" data-toggle="tab">' . $this->clean($hallData['name']) . '</a></li>';

            $order += 1;
        }
    ?>
    </ul>

    <div class="tab-content" id="show_tabs">
    <?php
        $order = 0;
        foreach ($halls as $hallId => $hallData) {
            $class = $order == 0 ? 'tab-pane active' : 'tab-pane';
        ?>

        <div class="<?php echo $class; ?>" id="hall<?php echo $hallId; ?>">
            <div class="tabbable tabs-left">
                <ul class="nav nav-tabs show_trigger_tab">
                    <?php
                    $showOrder = 0;
                    foreach ($hallData['shows'] as $showId => $showData) {
                        $showClass = $showOrder == 0 ? ' class="active trigger"' : ' class="trigger"';
                    ?>
                        <li<?php echo $showClass; ?>><a href="#hall_<?php echo $hallId; ?>_<?php echo $showId; ?>_<?php echo $showData['representation_id']; ?>_content" id="hall_<?php echo $hallId; ?>_<?php echo $showId; ?>_<?php echo $showData['representation_id']; ?>_trigger" data-toggle="tab"><?php echo $this->clean($showData['name']); ?><br /><?php echo $this->clean(date('H:i', strtotime($showData['representation_date']))); ?></a></li>
                    <?php
                    $showOrder += 1;
                    } ?>
                </ul>

                <div class="tab-content">
                    <?php 
                    $showOrder = 0;
                    foreach ($hallData['shows'] as $showId => $showData) {
                        $showClass = $order == 0 && $showOrder == 0 ? 'tab-pane active' : 'tab-pane';
                    ?>
                        <div class="<?php echo $showClass; ?>" id="hall_<?php echo $hallId; ?>_<?php echo $showId; ?>_<?php echo $showData['representation_id']; ?>_content">show<?php echo $showId; ?></div>
                    <?php
                    $showOrder += 1;
                    } ?>
                </div>
            </div>
        </div>

    <?php
            $order += 1;
        }
    ?>
    </div>
</div>

<br style="clear: both" />

<div style="float: left; width: 100px; line-height: 30px"><strong>Legend:</strong></div>
<span class="seat-no legend badge badge-success">Free seat</span>
<span class="seat-no legend badge badge-important">Booked seat</span>
<span class="seat-no legend badge badge-warning">Selected seats</span>
